package com.runda.partypolicy.app.di.modules;


import com.runda.partypolicy.app.di.AppViewModelFactory;
import com.runda.partypolicy.app.di.others.ViewModelKey;
import com.runda.partypolicy.app.page.viewmodel.ViewModel_Login;
import com.runda.partypolicy.app.page.viewmodel.ViewModel_Main;
import com.runda.partypolicy.app.page.viewmodel.ViewModel_Main_AddressBook;
import com.runda.partypolicy.app.page.viewmodel.ViewModel_Main_Message;
import com.runda.partypolicy.app.page.viewmodel.ViewModel_Main_Mine;
import com.runda.partypolicy.app.page.viewmodel.ViewModel_Main_Office;
import com.runda.partypolicy.app.page.viewmodel.ViewModel_Main_Task;
import com.runda.partypolicy.app.page.viewmodel.ViewModel_Office_First;
import com.runda.partypolicy.app.page.viewmodel.ViewModel_Office_Second;
import com.runda.partypolicy.app.page.viewmodel.ViewModel_Splash;
import com.runda.partypolicy.app.page.viewmodel.ViewModel_Task;

import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelProvider;


import dagger.Binds;
import dagger.Module;
import dagger.multibindings.IntoMap;

/**
 * author:  robin_zzw
 * date:    2018/1/10
 * version: v1.0
 * description: viewMode的Module
 */
@Module
public abstract class ViewModelModule {
    @Binds
    abstract ViewModelProvider.Factory bindViewModelFactory(AppViewModelFactory viewModelFactory);

    @Binds
    @IntoMap
    @ViewModelKey(ViewModel_Splash.class)
    abstract ViewModel bindViewModel_Splash(ViewModel_Splash viewModel);

    @Binds
    @IntoMap
    @ViewModelKey(ViewModel_Login.class)
    abstract ViewModel bindViewModel_Login(ViewModel_Login viewModel);


    @Binds
    @IntoMap
    @ViewModelKey(ViewModel_Main.class)
    abstract ViewModel bindViewModel_MainPage(ViewModel_Main viewModel);

    @Binds
    @IntoMap
    @ViewModelKey(ViewModel_Main_Message.class)
    abstract ViewModel bindViewModel_Main_Message(ViewModel_Main_Message viewModel);

    @Binds
    @IntoMap
    @ViewModelKey(ViewModel_Main_AddressBook.class)
    abstract ViewModel bindViewModel_Main_AddressBook(ViewModel_Main_AddressBook viewModel);

    @Binds
    @IntoMap
    @ViewModelKey(ViewModel_Main_Task.class)
    abstract ViewModel bindViewModel_Main_Task(ViewModel_Main_Task viewModel);

    @Binds
    @IntoMap
    @ViewModelKey(ViewModel_Main_Office.class)
    abstract ViewModel bindViewModel_Main_Office(ViewModel_Main_Office viewModel);

    @Binds
    @IntoMap
    @ViewModelKey(ViewModel_Main_Mine.class)
    abstract ViewModel bindViewModel_Main_Mine(ViewModel_Main_Mine viewModel);

    //
    @Binds
    @IntoMap
    @ViewModelKey(ViewModel_Office_First.class)
    abstract ViewModel bindViewModel_Office_First(ViewModel_Office_First viewModel);

    @Binds
    @IntoMap
    @ViewModelKey(ViewModel_Office_Second.class)
    abstract ViewModel bindViewModel_Office_Second(ViewModel_Office_Second viewModel);

    @Binds
    @IntoMap
    @ViewModelKey(ViewModel_Task.class)
    abstract ViewModel bindViewModel_FunctionCenter(ViewModel_Task viewModel);
}
